import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * This class implements a queue of customers as a circular buffer.
 */
public class CustomerQueue extends LinkedBlockingQueue<Customer> {
	/**
	 * Creates a new customer queue.
	 * @param queueLength	The maximum length of the queue.
	 * @param gui			A reference to the GUI interface.
	 */
  
	private Gui gui;
	
	public CustomerQueue(int queueLength, Gui gui) {
		
    	super(queueLength);
    	this.gui = gui;
    	// Incomplete
    	
	}

	public boolean addCustomer(){
		
		Customer customer = new Customer();
		
		try {
			this.put(customer);
			customer.chairNumber = BarbershopGui.queue.size()-1;
			gui.fillLoungeChair(customer.chairNumber, customer);
			
	
		} catch (InterruptedException e) {
		
			e.printStackTrace();
			return false;
		}
		
		return true;
	}
	
	// Being debugged, change me please
	public Customer removeCustomer(){
		try{
			return this.remove();
		}catch(NoSuchElementException e){
			
			return null;
		}
	}
	
	// Add more methods as needed
}


